package com.example.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.system.domain.BusSystemReceivemsg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.bouncycastle.asn1.misc.IDEACBCPar;

import java.util.List;

/**
* @author CETC
* @description 针对表【bus_system_receivemsg_1】的数据库操作Mapper
* @createDate 2025-10-25 13:52:39
* @Entity com.example.system.domain.BusSystemReceivemsg1
*/
public interface BusSystemReceivemsgMapper extends BaseMapper<BusSystemReceivemsg> {


    @Select("SELECT * FROM ${tableName} WHERE to_uid = #{toUid} and is_deleted='0' order by create_time desc")
    public List<BusSystemReceivemsg> selectByBusTableNameAll(@Param("tableName") String tableName,@Param("toUid")String toUid);

    @Select("SELECT * FROM ${tableName} WHERE to_uid = #{toUid} and from_uid = #{fromUid} and is_deleted='0' order by create_time desc")
    public List<BusSystemReceivemsg> selectByBusTableName(@Param("tableName") String tableName,@Param("toUid")String toUid,@Param("fromUid")String fromUid);

    @Select({"<script>" +
            "SELECT * FROM ${tableName} WHERE to_uid = #{toUid} and is_deleted='0' order by create_time desc" +
            "</script>"})
    public  IPage<BusSystemReceivemsg> selectPageAll(@Param("tableName") String tableName,@Param("toUid")String feild, Page<BusSystemReceivemsg> page);

    @Select({"<script>" +
            "SELECT * FROM ${tableName} WHERE to_uid = #{toUid} and from_uid = #{fromUid} and is_deleted='0' order by create_time desc" +
            "</script>"})
    public  IPage<BusSystemReceivemsg> selectPage(@Param("tableName") String tableName,@Param("toUid")String feild, @Param("fromUid")String fromUid,Page<BusSystemReceivemsg> page);

}




